<template>
	<view class="contont">
		<view style="width: 355px;height: 160px;margin-top: 20rpx;">
			<image src="../../static/img/bg_wode@2x.png" style="width: 355px;height: 160px;" mode=""></image>
			<view style="display: flex;align-items: center;margin-top: 55px;position: absolute;top: 10px;">
				<image :src="getImgUrl(list.touxiang_path)" mode="" style="width: 50px;height: 50px;margin-left: 10px;"></image>
				<text style="color: #000000;font-size: 18px;margin-left: 10px;">{{list.phone}}</text>
			</view>
		</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="indor" >
			<view class="cent" >
				<image src="../../static/img/icon_geren@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">个人信息</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent"  @click="veh">
			<view class="cent">
				<image src="../../static/img/icon_huoche@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">认证车辆</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
		<view style="width: 100%;height: 5px;background: #f5f5f5;">	</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="cardce">
			<view class="cent">
				<image src="../../static/img/icon_yinhangka@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">我的银行卡</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="forget" >
			<view class="cent">
				<image src="../../static/img/icon_shezhi@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">账号设置</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="feed">
			<view class="cent">
				<image src="../../static/img/icon_yijian@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">意见反馈</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
			<view style="width: 100%;height: 5px;background: #f5f5f5;">	</view>
		<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="about">
			<view class="cent">
				<image src="../../static/img/icon_guanyu@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
				<text style="font-size: 15px;color: #777777;">关于我们</text>
			</view>
			<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
		</view>
	<view style="height: 51px;width: 100%;border-bottom: 1px solid #F5F5F5;" class="cent" @click="out">
		<view class="cent">
			<image src="../../static/img/icon_tuichu@2x.png" mode="" style="width: 17px;height: 17px;margin-left: 14px;margin-right: 7px;"></image>
			<text style="font-size: 15px;color: #777777;">退出登录</text>
		</view>
		<image src="../../static/img/icon_youzhuan@2x.png" mode="" style="width: 7px;height: 13px;margin-right: 20px;"></image>
	</view>
	</view>
</template>

<script>
	import {ajaxs} from '../../apis.js'
	export default {
		data() {
			return {
				list:"",
			}
		},
		onLoad() {
			uni.showLoading({
			    title: '加载中！'
			});
			var that=this
			ajaxs({
				url:"/v1/appdriver/user/profile",
				success(res){
					uni.hideLoading()
					that.list=res.data.message
				}
			})
		},
		methods: {
			getImgUrl(icon){
				   return "https://www.uhuoda.com/"+icon;
				},
			// 关于我们
			about(){
				uni.navigateTo({
					url:"./about"
				})
			},
			// 意见反馈
			feed(){
				uni.navigateTo({
					url:"./Feedback"
				})
			}, 
			// 个人信息
			forget(){
				uni.navigateTo({
					url:"../index/forgeted?id="+this.list.id
				})
			},
			// 车辆
			veh(){
				uni.navigateTo({
					url:"./vehicle"
				})
			},
			// 退出
			out(){
				uni.showModal({
							
				    content: '请您确认退出登陆',
									
				    success: function (res) {
									
				      if (res.confirm) {//这里是点击了确定以后
									uni.clearStorage();
									uni.reLaunch({
										url:"../index/index"
									})
				        
									
				      } else {//这里是点击了取消以后
									
			
									
				      }
									
				    }
									
				  })
			},
			// 银行卡
			cardce(){
				uni.navigateTo({
					 url:"./card"
				})
			},
			// 个人信息
			indor(){
				var that=this
				ajaxs({
					url:"/v1/appdriver/user/profile",	
					success(res){
						console.log(res)
						if(res.data.message.username==""){
						uni.navigateTo({
					url:"../information/information",
						})
						}else{
							uni.navigateTo({
								url:"./carded",
								
							})
						}
						
					}
				})

			}
		}
	}
</script>

<style>

</style>
